<?php


class Comment {

    static public function dealCmts(array $comments, $parent_id = 0){
        $arr = array();
        foreach($comments as $value){
            if($value['parent_id'] == $parent_id){
                $value['child'] = self::dealCmts($comments, $value['id']);
                $arr[] = $value;
            }
        
        }
        return $arr;
    
    }


}